﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="get_Talking.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Lesson.get_Talking" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        int id = int.Parse(Request.QueryString["id"]);
        var get_talk1 = new TblLessonTalkingController().FetchAll().Where(x => x.LessonId == id).Single(); 
         %>
    <ul class="w3-navbar w3-black">
        <li><a href="javascript:;" class="converlink w3-red" onclick="openconver(event, 'Talk1');">Bài hội thoại</a></li>
        <li><a href="javascript:;" class="converlink" onclick="openconver(event, 'Talk2');">Mẫu hội thoại</a></li>
        <li><a href="javascript:;" class="converlink" onclick="openconver(event, 'Talk3');">Bài học về văn hóa</a></li>
    </ul>
    <div id="Talk1" class="hoithoai w3-padding w3-border-red converpart">
        <div class="w3-hide talk_id"><%=get_talk1.TalkId %></div>
        <div class="w3-row w3-margin-top">
            <textarea id="talk_content" class="talk_content"><%=get_talk1.TalkContent %></textarea>
        </div>
        <ul class="w3-ul">
            <li>
                <div class="w3-row">
                    <a class="w3-text-red">Đáp án</a><br />
                    <div class="themvidu w3-threequarter">
                        <textarea id="talk_result_content" class="talk_result"><%=get_talk1.TalkResult %></textarea>
                    </div>
                </div>
            </li>
        </ul>
        <div class="w3-row w3-center w3-padding">
            <a class="w3-btn w3-red btn_edit_talking"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
        </div>
    </div>
    <div id="Talk2" class="hoithoai w3-padding w3-border-red converpart" style="display: none">
        <%var get_talk2 = new TblLessonTalkingContentController().FetchAll().Where(x => x.TalkId == get_talk1.TalkId);  %>
        <div id="Talk_little_area">
            <%foreach(TblLessonTalkingContent talk in get_talk2){ %>
            <div id="talk_ct_<%=talk.TalkCtId %>" class="w3-row w3-border w3-margin-bottom">
            <header class="small-talk-name lesson-child-name w3-row w3-padding w3-red w3-large">
                <i class="muiten fa fa-chevron-down w3-right w3-padding-top"></i>
                <input value="<%=talk.TalkCtName %>" type="text" placeholder="Nhập tên mẫu hội thoại" id="txt_talkct_name<%=talk.TalkCtId %>" class=" w3-text-black w3-half" />
            </header>
            <div class="lesson-child-content w3-row w3-padding">
                <div class="w3-row w3-margin-top">
                    <textarea id="talk_CT_Content<%=talk.TalkCtId %>" class="talk_content"><%=talk.TalkContent %></textarea>
                </div>
                <ul class="w3-ul">
                    <li>
                        <div class="w3-row">
                            <a class="w3-text-red">Đáp án</a><br />
                            <div class="themvidu">
                                <textarea id="talk_CT_Result<%=talk.TalkCtId %>" class="talk_content"><%=talk.TalkSub %></textarea>
                            </div>
                        </div>
                    </li>
                </ul>
                <div class="w3-padding">
                    <label class="w3-large w3-text-red">Luyện tập:</label>
                </div>
                <div class="w3-row">
                    <textarea id="talk_CT_Train<%=talk.TalkCtId %>" class="talk_content"><%=talk.TalkTrainning %></textarea>
                </div>
                <div class="w3-row w3-center w3-padding-top">
                    <div class="w3-hide talk_content_id"><%=talk.TalkCtId %></div>
                    <a onclick="save_talking_ct(<%=talk.TalkCtId %>)" class="w3-btn w3-red"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>&nbsp;<a onclick="del_talking_ct(<%=talk.TalkCtId %>)" class="w3-btn w3-red"><i class="fa fa-trash"></i>&nbsp;Xóa mẫu đàm thoại</a>
                </div>
            </div>
        </div>
            <%} %>
        </div>
        
        <div class="w3-row"><a onclick="document.getElementById('themhoithoai').style.display = 'block'" class="w3-btn w3-red"><i class="fa fa-plus"></i>&nbsp;Thêm mẫu hội thoại</a></div>
    </div>
    <div id="Talk3" class="hoithoai w3-padding w3-border-red converpart" style="display: none">
         <div class="w3-row w3-margin-top">
            <textarea id="talking_cultural" class="talk_cultural"><%=get_talk1.TalkCultural %></textarea>
        </div>
        
        <div class="w3-row w3-center w3-padding">
            <a onclick="edit_talking_cultural(<%=get_talk1.TalkId %>)" class="w3-btn w3-red btn_edit_talking_cultural"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
        </div>
    </div>
</body>
</html>
